package com.yjx.gulimall.product.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import com.yjx.gulimall.common.valid.AddGroup;
import com.yjx.gulimall.common.valid.UpdateGroup;
import lombok.Data;

import javax.validation.constraints.*;

/**
 * 属性分组
 * 
 * @author zhuyingcoder
 * @email 1210736981@qq.com
 * @date 2022-01-23 12:30:17
 */
@Data
@TableName("pms_attr_group")
public class AttrGroupEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 分组id
	 */
	@TableId
	@NotNull(message = "update:分组id不能为空",groups = {UpdateGroup.class})
	@Null(message = "save:分组id必须是null",groups = {AddGroup.class})
	private Long attrGroupId;
	/**
	 * 组名
	 */
	@NotBlank(message = "组名不能为空", groups = {AddGroup.class, UpdateGroup.class})
	private String attrGroupName;
	/**
	 * 排序
	 */
	@Min(value = 1,message = "排序必须是一个大于零的整数" ,groups = {AddGroup.class,UpdateGroup.class})
	private Integer sort;
	/**
	 * 描述
	 */
	@NotBlank(message = "组名不能为空", groups = {AddGroup.class, UpdateGroup.class})
	private String descript;
	/**
	 * 组图标
	 */
	private String icon;
	/**
	 * 所属分类id
	 */
	private Long catelogId;

	/**
	 * 返回三级分类的categoryId
	 */
	@TableField(exist = false)
	private Long[] catelogPath;

}
